<?php
use yii\grid\GridView;
use backend\utils\XHtml;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '幻灯片管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $this->beginBlock('content-header'); ?>
<?= $this->title . ' ' . XHtml::create('幻灯片') ?>
<?php $this->endBlock(); ?>
<div class="box box-primary">
    <div class="box-body">
        <?= GridView::widget([
            'dataProvider' => $dataProvider,
            'columns' => [
                'id',
                'name',
                ['class' => backend\utils\XColumn::className(), 'template' => '{update} &nbsp;&nbsp; {delete} &nbsp;&nbsp; {items}',
                    'buttons' => [
                        'items' => function ($url, $model, $key) {
                            return Html::a('<span class="glyphicon glyphicon-picture"></span>',
                                Url::to(['item-index', 'banner_id' => $model->id]),
                                ['title' => '管理图片']);
                        }
                    ]
                ]
            ]
        ]); ?>
    </div>
</div>